//
//  MacroDefinition.h
//  ios-loan
//
//  Created by guoqingping on 2017/12/15.
//  Copyright © 2017年 hxhg. All rights reserved.
//

#ifndef MacroDefinition_h
#define MacroDefinition_h

#import "Utilities.h"

#import "Utilities.h"

//通过plist文件，获取数据
#define GetGlobalApiByKey(__key__) ([NSDictionary dictionaryWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"ALGlobalConfig" ofType:@"plist"]][__key__])

#define GetEnvironmentApiByKey(__key__) ([Utilities getApiByKey:__key__])
#define GetChannelApiByKey(__key__) ([Utilities getChannelByKey:__key__])

#pragma mark Device
#pragma mark -
#define isIOS4 ([[[UIDevice currentDevice] systemVersion] intValue]==4)
#define isIOS5 ([[[UIDevice currentDevice] systemVersion] intValue]==5)
#define isIOS6 ([[[UIDevice currentDevice] systemVersion] intValue]==6)
#define isIOS7 ([[[UIDevice currentDevice] systemVersion] intValue]==7)
#define isIOS8 ([[[UIDevice currentDevice] systemVersion] intValue]==8)
#define isIOS9 ([[[UIDevice currentDevice] systemVersion] intValue]==9)

#define isAfterIOS4 ([[[UIDevice currentDevice] systemVersion] intValue]>=4)
#define isAfterIOS5 ([[[UIDevice currentDevice] systemVersion] intValue]>=5)
#define isAfterIOS6 ([[[UIDevice currentDevice] systemVersion] intValue]>=6)
#define isAfterIOS7 ([[[UIDevice currentDevice] systemVersion] intValue]>=7)
#define isAfterIOS8 ([[[UIDevice currentDevice] systemVersion] intValue]>=8)
#define isAfterIOS9 ([[[UIDevice currentDevice] systemVersion] intValue]>=9)

//-------------------设备尺寸-------------------------
//NavBar高度
#define kNavigationBar_HEIGHT 44
#define kStatusBar_HEIGHT [[UIApplication sharedApplication] statusBarFrame].size.height
#define kNavigationAndStatusBarHeight (kNavigationBar_HEIGHT + kStatusBar_HEIGHT)
#define kTabbarHeight  ([[UIApplication sharedApplication] statusBarFrame].size.height>20?83:49)
#define kIphonexTabbarVirtualHeight 34 //iPhone X底部虚拟区高度
//获取屏幕 宽度、高度
#define kSCREEN_WIDTH ([UIScreen mainScreen].bounds.size.width)
#define kSCREEN_HEIGHT ([UIScreen mainScreen].bounds.size.height)

#define kLaunchInitPath [kDocumentDir stringByAppendingPathComponent:@"launchInit"]


// 业务相关
//用户信息更新
#define kLoan_UserInfoUpdateNotification @"Loan_UserInfoUpdateNotification"
//登录成功
#define kDidReceivedSuccessLoginNotification @"didReceivedSuccessLoginNotification"
//退出登录
#define kDidReceivedLoginOutNotification @"didReceivedLoginOutNotification"
//支付完成
#define kDidPaidNotification @"didPaidNotification"
//登录信息失效通知
#define kDidReceivedAccoutInvalidNotification @"didReceivedAccoutInvalidNotification"
//点击了推送贷款产品的通知
#define kDidReceivedLoanRemoteNotification @"didReceivedLoanRemoteNotification"
//监听注册成功
#define kDidReceivedRegisterSuccessNotification @"didReceivedRegisterSuccessNotification"
//产品已下架，需要刷新首页
#define kDidReceivedProductUnderShellNotification @"didReceivedProductUnderShellNotification"

//订单管理 订单状态发生了变化
#define kProductionStatusChangedNotification @"productionStatusChangedNotification"
//首页  购买状态发生了变化
#define kProductionPurchaseStatusChangedNotification @"productionPurchaseStatusChangedNotification"


#define kPopPageNotification @"kPopPageNotification"

#define kCurPhoneNum @"kCurPhoneNum"


//#define kDe


#endif /* MacroDefinition_h */
